#include <socket.h>

#include <iostream>
using std::cout;
using std::endl;

#include <string>
using std::string;

//Test with wireshark ;)

int main(int argc, char *argv[])
{
	string dato;
	char dnsQuery[] = {
		0x64, 0x31, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 
		0x00, 0x00, 0x00, 0x00, 0x06, 0x67, 0x6f, 0x6f, 
		0x67, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00, 
		0x00, 0x01, 0x00, 0x01 };
	//Initialize network(just for windows compatibility)
	Net n;

	//Test udp sockets sending a dns query about google.com to a dns server
	UdpSocket u;
	u.setPeer("200.63.155.192",53);
	u.send(dnsQuery, sizeof(dnsQuery));

	//Test tcp sockets sending a request to a http server
	TcpSocket s;
	s.connect("google.com",80);
	s.send("GET / HTTP/1.1 \r\n\r\n");
	{
		s.recv(dato, 40000);
		cout << dato << endl; 
	}
	//u.send(dato);
}
